-
Notifications
You must be signed in to change notification settings - Fork 21
Add audio recording support for WPForms GoDAM Recorder #1446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Import Uppy audio CSS styles in WPForms stylesheet - Add audio player styles matching Ninja Forms implementation - Remove inline styles from entry view/edit templates - Detect audio files and render audio player conditionally - Set correct job_type for audio transcoding requests
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
missing_composer_json_file | The "/vendor" directory using composer exists, but "composer.json" file is missing. |
📁 readme.txt (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" is different from the name declared in plugin header "GoDAM". |
0 |
trademarked_term | The plugin name includes a restricted term. Your chosen plugin name - "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" - contains the restricted term "wordpress" which cannot be used at all in your plugin name. |
📁 inc/classes/media-library/class-media-folder-utils.php (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
91 |
PluginCheck.Security.DirectDB.UnescapedDBParameter | Unescaped parameter $where_clause used in $wpdb->get_var($wpdb->prepare(\n\t\t\t\t"\n\t\t\tSELECT COUNT(DISTINCT p.ID)\n\t\t\tFROM {$wpdb->posts} p\n\t\t\tINNER JOIN {$wpdb->term_relationships} tr ON p.ID = tr.object_id\n\t\t\tINNER JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id = tt.term_taxonomy_id\n\t\t\tWHERE {$where_clause}\n\t\t",\n\t\t\t\t$query_params\n\t\t\t))\n$where_clause assigned unsafely at line 82:\n $where_clause .= ' AND p.post_mime_type LIKE %s'\n$query_params[] used without escaping.\n$mime_type used without escaping. |
📁 assets/build/css/main.css (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedStylesScope | This style is being loaded in all contexts. |
📁 assets/src/libs/analytics.min.js (6 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?p=1 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?page_id=2 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?attachment_id=6 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?godam-video=demo-godam-video-post (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
📁 assets/build/js/main.min.js (6 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?p=1 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?page_id=2 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?attachment_id=6 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/?godam-video=demo-godam-video-post (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds audio recording support to the WPForms GoDAM Recorder field, extending it beyond video-only functionality.
- Implements audio file detection using MIME type checking and name-based fallback for
.webmfiles - Updates UI elements to be more generic (button text changed from "Record Video" to "Start Recording")
- Adds audio player rendering in entry view and edit pages with transcoding support
- Sets correct transcoding job type (
audiovsstream) based on detected file type
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| inc/classes/wpforms/wpforms-field-godam-record-frontend.php | Updates button text to be more generic for both audio and video recording |
| inc/classes/wpforms/wpforms-field-godam-record-entry-view.php | Adds audio file detection and renders HTML5 audio player for audio files |
| inc/classes/wpforms/wpforms-field-godam-record-entry-edit.php | Adds audio file detection and renders HTML5 audio player in entry edit view |
| inc/classes/wpforms/class-wpforms-integration.php | Detects file type and passes correct job_type parameter to transcoding function |
| inc/classes/wpforms/class-wpforms-field-godam-video.php | Adds "Audio" option to file selection settings and accepts audio MIME types for upload |
| assets/src/css/wpforms-uppy-video.scss | Imports Uppy audio CSS and adds styling for audio player elements in various contexts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mi5t4n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $mime_type = ! empty( $file_type['type'] ) ? $file_type['type'] : ''; | ||
| $is_audio = ! empty( $mime_type ) && strpos( $mime_type, 'audio' ) !== false; | ||
|
|
||
| if ( 'webm' === $file_type['ext'] && godam_is_audio_file_by_name( $godam_value ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason we are explicitly checking for the webm extension? Can't there be other audio formats?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filetype of screencapture, video or audio is mainly decided by browsers. REF REF
From the uppy docs:
If no preferred video mime type is given, the ScreenCapture plugin [audio & video] will prefer types listed in the allowedFileTypes restriction, if any.
We have not specified any mime type for audio/video instead we have added a allowedFileTypes list here, so the browser defaults are being taken.
For example in my testing:
- Chromium browsers (Edge, Chrome) save both video and audio in
.webmformat - Firefox saves audio in
.oggand video in.webm
So we had added an additional check that if the extension is .webm then we can fallback on 'audio' string in the filename.
However on further testing I found that Safari saves both audio and video in .mp4 so I've updated the godam_is_audio_file to take care of both cases .webm and .mp4
|
Added the fixes for #1446 (review)
I noticed that the video links were not working either. Implemented the fix for both.
Since, audio files are not being transcoded, I've updated the message accordingly for audio files:
|
mi5t4n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM



Issue: #1274
Implements audio recording support for WPForms GoDAM Recorder field.
.webmaudio files using name-based detectionNote: Referenced #1194 for consistency.
Demo
Screen.Recording.2026-01-02.at.5.20.39.PM.mov